package com.youku.mson.util;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Map;

public class TypeUtils {

	public static boolean isFloat(Class<?> targetClass) {
		return targetClass == float.class || targetClass == Float.class;
	}

	public static boolean isDouble(Class<?> targetClass) {
		return targetClass == double.class || targetClass == Double.class;
	}

	public static boolean isInteger(Class<?> targetClass) {
		return targetClass == int.class || targetClass == Integer.class;
	}

	public static boolean isByte(Class<?> targetClass) {
		return targetClass == byte.class || targetClass == Byte.class;
	}

	public static boolean isShort(Class<?> targetClass) {
		return targetClass == short.class || targetClass == Short.class;
	}

	public static boolean isLong(Class<?> targetClass) {
		return targetClass == long.class || targetClass == Long.class;
	}

	public static boolean isBoolean(Class<?> targetClass) {
		return targetClass == boolean.class || targetClass == Boolean.class;
	}

	public static boolean isCharacter(Class<?> targetClass) {
		return targetClass == char.class || targetClass == Character.class;
	}

	public static boolean isBigInteger(Class<?> targetClass) {
		return targetClass == BigInteger.class;
	}

	public static boolean isBigDecimal(Class<?> targetClass) {
		return targetClass == BigDecimal.class;
	}

	public static boolean isMap(Class<?> targetClass) {
		return Map.class.isAssignableFrom(targetClass);
	}
}
